/*
包含n个接口请求函数的模块
函数的返回值: promise对象
 */
import ajax from "./ajax";
const BASE_URL = "http://8.140.158.200:8080/zhang/demo/pri";
// const BASE_URL = "http://192.168.199.147:8080/zhang/demo/pri";

//1.用户注册
export const reqRegister = ({ username, password, password1, email, code }) =>
  ajax(
    BASE_URL + "/register",
    {
      username,
      password,
      password1,
      email,
      code,
    },
    "POST"
  );
// 2、用户名密码登陆
export const reqLogin = ({ username, password }) =>
  ajax(BASE_URL + "/login", { username, password }, "POST", {});
// 3.基本信息保存
export const reqinformation = ({ name, sex, blood, age, type, introduction }) =>
  ajax(
    BASE_URL + "/information",
    {
      name,
      sex,
      blood,
      age,
      type,
      introduction,
    },
    "POST"
  );

// 4.发送验证码
export const reqSendcode = (email) =>
  ajax(BASE_URL + `/code/${email}`, { email });
// 5.用户信息
export const reqInfo = () => ajax(BASE_URL + "/upload", {}, "GET");
//6.图像接口
export const reqList = () => ajax(BASE_URL + "/upload", {}, "GET");
export const reqimage = (id) => ajax(BASE_URL + "/query", { id }, "GET");
//养生接口
export const reqyang = () => ajax(BASE_URL + "/image1", {}, "GET");
export const reqyangsheng = (id) => ajax(BASE_URL + "/query1", { id }, "GET");
// 8、添加手机联系人
export const reqTel = ({ name1, phone }) =>
  ajax(BASE_URL + "/phone", { name1, phone }, "POST");
export const reqtel = () => ajax(BASE_URL + "/home", {}, "GET");
// 9.实名认证
export const reqShiM = ({ name2, card }) =>
  ajax(BASE_URL + "/shiming", { name2, card }, "POST");
// 动态
export const reqDong = () => ajax(BASE_URL + "/fanhui", {}, "GET");

export const reqtai = ({ page }) => ajax(BASE_URL + "/page", { page }, "POST");
// 商品列表
export const reqShopgoods = () => ajax("/goods");
